package com.zb.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zb.entity.TbOrderModel;
import com.zb.service.TbOrderService;

import com.zb.util.TokenDecode;
import com.zb.vo.BuyGoodsVO;
import com.zb.vo.OrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException;
import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName TbOrderController
 * @Description 控制器
 * @Author xm
 * @Date 2024/11/07 09:05
 **/
@RestController
@RequestMapping("/tb-order-model")

	public class TbOrderController {

	@Autowired
	public TbOrderService tbOrderModelService;
	@PostMapping("/create-order")
	public Boolean createOrder(
			@RequestBody OrderVO orderVO) {
		String username = TokenDecode.getUserInfo().get("username");
		orderVO.setUsername(username);
		return tbOrderModelService.createOrder(orderVO);
	}


}

